<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

Route::pattern([
    'name' => '\w+',
    'id' => '\d+',
    'cid' => '\d+',
    'page' => '\d+',
]);

Route::domain('admin', function () {
    // 动态注册域名的路由规则
    Route::get('/', 'admin/index/index');
    Route::rule('/login', 'admin/login/index');
    Route::rule('/logout', 'admin/login/logout');
    Route::get('/captcha', 'admin/login/makecaptcha');
    Route::rule('/forgot', 'admin/login/getpwd');
    Route::rule('/sendemail', 'admin/login/emailVerify');
    Route::rule('/resetpwd', 'admin/login/resetPwd');
    Route::get('/index', 'admin/index/index');
    Route::post('/getsitesize', 'admin/index/getSiteSize');
    Route::post('/cleartemp', "admin/index/clearTemp");
    Route::get('/admin_user/index', "admin/admin_user/index");
    Route::rule('/admin_user/add', "admin/admin_user/add");
    Route::rule('/admin_user/edit/:id', "admin/admin_user/edit");
    Route::post('/admin_user/del', "admin/admin_user/del");
    Route::post('/admin_user/status', "admin/admin_user/status");
    Route::rule('/admin_user/modifypwd', "admin/admin_user/modifypwd");
    Route::post('/admin_user/modify', "admin/admin_user/modify");
    Route::get('/admin_role/index', "admin/admin_role/index");
    Route::rule('/admin_role/add', "admin/admin_role/add");
    Route::rule('/admin_role/edit/:id', "admin/admin_role/edit");
    Route::post('/admin_role/del', "admin/admin_role/del");
    Route::get('/permission/index', "admin/permission/index");
    Route::rule('/permission/add', "admin/permission/add");
    Route::rule('/permission/edit/:id', "admin/permission/edit");
    Route::post('/permission/del', "admin/permission/del");
    Route::rule('/file_manager/upload', "admin/file_manager/upload");
    Route::rule('/file_manager/index/:dir', "admin/file_manager/index");
    Route::rule('/file_manager/index', "admin/file_manager/index");
    Route::post('/file_manager/del', "admin/file_manager/del");
    Route::post('/file_manager/deldir', "admin/file_manager/delDir");
    Route::rule('/file_manager/selectpicture', "admin/file_manager/selectpicture");
    Route::rule('/file_manager/uploadpicture', "admin/file_manager/uploadpicture");
    Route::rule('/file_manager/onlinepicture', "admin/file_manager/onlinepicture");
    Route::get('/blog_article/index/:page', "admin/blog_article/index");
    Route::get('/blog_article/index', "admin/blog_article/index");
 
    Route::get('/blog_article/preview/:id', "admin/blog_article/preview", ['ext'=>'html'], ['id' => '\d+']);
    Route::rule('/blog_article/add/:cid', "admin/blog_article/add");
    Route::rule('/blog_article/add', "admin/blog_article/add");
    Route::rule('/blog_article/title', "admin/blog_article/title");
    Route::rule('/blog_article/edit/:id', "admin/blog_article/edit");
    Route::rule('/blog_article/edit', "admin/blog_article/edit");
    Route::post('/blog_article/del', "admin/blog_article/del");
    Route::post('/blog_article/topstatus', "admin/blog_article/topstatus");
    Route::get('/blog_article/trash', "admin/blog_article/trash");
    Route::post('/blog_article/realdel', "admin/blog_article/realdel");
    Route::post('/blog_article/testtitle', "admin/blog_article/testtitle");
    Route::post('/blog_article/restore', "admin/blog_article/restore");



    Route::get('/fun_article/index', "admin/fun_article/index");
    Route::post('/fun_article/del', "admin/fun_article/del");
    Route::post('/fun_article/topstatus', "admin/fun_article/topstatus");
    Route::get('/fun_article/trash', "admin/fun_article/trash");
    Route::post('/fun_article/realdel', "admin/fun_article/realdel");
    Route::post('/fun_article/restore', "admin/fun_article/restore");
    Route::get('/fun_article/preview/:id', "admin/fun_article/preview", ['ext'=>'html'], ['id' => '\d+']);
    Route::rule('/fun_article/add', "admin/fun_article/add");
    Route::rule('/fun_article/edit/:id', "admin/fun_article/edit");
    Route::post('/fun_article/testtitle', "admin/fun_article/testtitle");
});

Route::domain('1219', function () {
    // 动态注册域名的路由规则
    Route::get('/', 'fun1219/index/index');
    Route::get('list', 'fun1219/index/articlelist');
    Route::rule('leacots', 'fun1219/index/leacots');
});

Route::domain('blog', function () {
    Route::get('/', 'blog/index/index');
    Route::get('/index', 'blog/index/index');
    Route::get('/lists/:cid/:page', 'blog/index/lists');
    Route::get('/lists/:cid', 'blog/index/lists?page=1');
    Route::get('/time/:page', 'blog/index/time');
    Route::get('/time', 'blog/index/time?page=1');
    Route::get('/read/:id', 'blog/index/read');
    Route::get('/:year/:month/:day/:id', 'blog/index/article');
    Route::post('/getlike', 'blog/index/getlike');
    Route::get('/about', 'blog/index/about');
    Route::get('/guestbook', 'blog/index/guestBook');
    Route::post('/saveguestbook', 'blog/index/saveGuestBook');
    Route::post('/error', 'blog/index/error');
});


Route::domain('2048', function () {
    // 动态注册域名的路由规则
    Route::get('/', 'fa2048/index/index');
    Route::get('/:any', 'fa2048/index/index');
});
Route::get('/', "@index/index/index");
Route::get('/:any', 'index/index/index');
